package com.mbs.project.mbs.dispose.service.impl;

import java.util.List;

import com.mbs.common.utils.DateUtils;
import com.mbs.common.utils.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mbs.project.mbs.dispose.mapper.MessageBoardDisposeMapper;
import com.mbs.project.mbs.dispose.domain.MessageBoardDispose;
import com.mbs.project.mbs.dispose.service.IMessageBoardDisposeService;

/**
 * 留言审核Service业务层处理
 *
 * @author xyl
 * @date 2022-02-03
 */
@Service
public class MessageBoardDisposeServiceImpl implements IMessageBoardDisposeService {
    @Autowired
    private MessageBoardDisposeMapper messageBoardDisposeMapper;

    /**
     * 查询留言审核
     *
     * @param mbDisposeId 留言审核ID
     * @return 留言审核
     */
    @Override
    public MessageBoardDispose selectMessageBoardDisposeById(Long mbDisposeId) {
        return messageBoardDisposeMapper.selectMessageBoardDisposeById(mbDisposeId);
    }

    /**
     * 查询留言审核列表
     *
     * @param messageBoardDispose 留言审核
     * @return 留言审核
     */
    @Override
    public List<MessageBoardDispose> selectMessageBoardDisposeList(MessageBoardDispose messageBoardDispose) {
        return messageBoardDisposeMapper.selectMessageBoardDisposeList(messageBoardDispose);
    }

    /**
     * 新增留言审核
     *
     * @param messageBoardDispose 留言审核
     * @return 结果
     */
    @Override
    public int insertMessageBoardDispose(MessageBoardDispose messageBoardDispose) {
        messageBoardDispose.setCreateTime(DateUtils.getNowDate());
        return messageBoardDisposeMapper.insertMessageBoardDispose(messageBoardDispose);
    }

    /**
     * 修改留言审核
     *
     * @param messageBoardDispose 留言审核
     * @return 结果
     */
    @Override
    public int updateMessageBoardDispose(MessageBoardDispose messageBoardDispose) {
        messageBoardDispose.setUpdateTime(DateUtils.getNowDate());
        return messageBoardDisposeMapper.updateMessageBoardDispose(messageBoardDispose);
    }

    /**
     * 删除留言审核对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMessageBoardDisposeByIds(String ids) {
        return messageBoardDisposeMapper.deleteMessageBoardDisposeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除留言审核信息
     *
     * @param mbDisposeId 留言审核ID
     * @return 结果
     */
    @Override
    public int deleteMessageBoardDisposeById(Long mbDisposeId) {
        return messageBoardDisposeMapper.deleteMessageBoardDisposeById(mbDisposeId);
    }

    @Override
    public int updateLevelBatch(MessageBoardDispose messageBoardDispose) {
        return messageBoardDisposeMapper.updateLevelBatch(messageBoardDispose);
    }

    @Override
    public int updateVerifierBatch(MessageBoardDispose messageBoardDispose) {
        return messageBoardDisposeMapper.updateVerifierBatch(messageBoardDispose);
    }

    @Override
    public int updateStatusByMbId(MessageBoardDispose messageBoardDispose) {
        return messageBoardDisposeMapper.updateStatusByMbId(messageBoardDispose);
    }

    @Override
    public int updateContentByMbId(MessageBoardDispose messageBoardDispose) {
        return messageBoardDisposeMapper.updateContentByMbId(messageBoardDispose);
    }
}
